<?php if (!defined('THINK_PATH')) exit();?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link href="__TMPL__Static/Css/style.css" rel="stylesheet" />
<script type="text/javascript" src="__TMPL__Static/Js/jquery.js"></script>
<script type="text/javascript" src="__TMPL__Static/Js/base.js"></script>
<script type="text/javascript" src="__TMPL__Static/Js/json.js"></script>
<script type="text/javascript" src="__TMPL__Static/Js/jquery.pngFix.js"></script>
<script type="text/javascript">
<!--
//指定当前组模块URL地址 
var URL = '__URL__';
var ROOT_PATH = '__ROOT__';
var APP	 =	 '__APP__';
var STATIC = '__TMPL__Static';
var VAR_MODULE = '<?php echo c('VAR_MODULE');?>';
var VAR_ACTION = '<?php echo c('VAR_ACTION');?>';
var CURR_MODULE = '<?php echo ($module_name); ?>';
var CURR_ACTION = '<?php echo ($action_name); ?>';

//定义JS中使用的语言变量
var CONFIRM_DELETE = '<?php echo L("CONFIRM_DELETE");?>';
var AJAX_LOADING = '<?php echo L("AJAX_LOADING");?>';
var AJAX_ERROR = '<?php echo L("AJAX_ERROR");?>';
var ALREADY_REMOVE = '<?php echo L("ALREADY_REMOVE");?>';
var SEARCH_LOADING = '<?php echo L("SEARCH_LOADING");?>';
var CLICK_EDIT_CONTENT = '<?php echo L("CLICK_EDIT_CONTENT");?>';
//-->
</script>
</head>
<body>
	<div class="fanwe-body">
		<div class="fb-title"><div><p><span><?php echo ($ur_href); ?></span></p></div></div>
		<div class="fb-body">
			<table class="body-table" cellpadding="0" cellspacing="1" border="0">
				<tr>
					<td class="body-table-td">
						<div class="body-table-div">
<script type="text/javascript" src="__TMPL__Static/Js/dataList.js"></script>
<script type="text/javascript">
var CONFIRM_ERROR = "<?php echo L("CONFIRM_ERROR");?>";
var CONFIRM_DELETE = "<?php echo L("CONFIRM_DELETE");?>";

function selectChild()
{
    var value = $("#parent_id").val();
    if(value == "id1") 
        document.getElementById('child_id').innerHTML = "<select name='zp_biaoqian' id='child_id'><?php if(is_array($my_list)): foreach($my_list as $key=>$category_item): ?><option value='<?php echo ($category_item["tag_name"]); ?>' ><?php echo ($category_item["tag_name"]); ?></option><?php endforeach; endif; ?></select>";
    else if(value=="id2") 
        document.getElementById('child_id').innerHTML = "<select name='zp_biaoqian' id='child_id'><?php if(is_array($ml_list)): foreach($ml_list as $key=>$category_item): ?><option value='<?php echo ($category_item["tag_name"]); ?>' ><?php echo ($category_item["tag_name"]); ?></option><?php endforeach; endif; ?></select>";
    else if(value=="id3") 
        document.getElementById('child_id').innerHTML = "<select name='zp_biaoqian' id='child_id'><?php if(is_array($ot_list)): foreach($ot_list as $key=>$category_item): ?><option value='<?php echo ($category_item["tag_name"]); ?>' ><?php echo ($category_item["tag_name"]); ?></option><?php endforeach; endif; ?></select>";
}
    
</script>
<div class="handle-btns">
	<div class="link-button "><p><a id="" name="" href="<?php echo Cookie::get('returnUrl');?>" class=""><?php echo L("RETURN_LIST");?></a></p></div>
</div>
<form method='post' id="form" name="form" action="<?php echo U(MODULE_NAME.'/update');?>" enctype="multipart/form-data">
<table cellpadding="4" cellspacing="0" border="0" class="table-form">
	<tr>
		<th width="180"><?php echo L("ZP_NAME");?></th>
		<td><input type="text" class="textinput requireinput" name="zp_name" value="<?php echo ($vo["zp_name"]); ?>"size =" 80"/></td>
	</tr>
        <tr>
		<th width="180"><?php echo L("ZP_PINGPAI");?></th>
		<td>
                    <table cellpadding="4" cellspacing="0" border="0" >
                        <tr style="none">
                            <td style="none">
                                <?php if(is_array($q_list)): foreach($q_list as $key=>$tag): ?><label><input style="font-size: 16px"  type="radio" name="zp_pingpai" value="<?php echo ($tag["tag_name"]); ?>" <?php if($tag["tag_id"] == $pp_id): ?>checked="checked"<?php endif; ?>/><span span style ="font-size: 16px"> <?php echo ($tag["tag_name"]); ?> </span></label><?php endforeach; endif; ?>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                如若没有添加的品牌， <a href="<?php echo U(GoodsCategory.'/index');?>">点击此处添加</a>
                            </td>
                        </tr>
                        
                    </table>
                    
                </td>
	</tr>
        <tr>
		<th width="180"><?php echo L("ZP_GONGXIAO");?></th>
		<td>
                    <table cellpadding="4" cellspacing="0" border="0" >
                        <tr>
                            <td>
                                <?php if(is_array($g_list)): foreach($g_list as $key=>$tag): ?><label><input type="checkbox" name="zp_gongxiao[]" value="<?php echo ($tag["tag_name"]); ?>" <?php if(in_array(($tag["tag_id"]), is_array($gx_id)?$gx_id:explode(',',$gx_id))): ?>checked="checked"<?php endif; ?>/><span style ="font-size: 16px"> <?php echo ($tag["tag_name"]); ?> </span></label><?php endforeach; endif; ?>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                如若没有相应的功效，<a href="<?php echo U(GoodsCategory.'/index');?>">点击此处添加</a>
                            </td>
                        </tr>
                    </table>
                    
                </td>
	</tr>
        <tr>
		<th width="180"><?php echo L("ZP_BIAOQIAN");?></th>
		<td>
                    <select name="parent_id" id="parent_id" onchange="selectChild()">
                        <option value ="id1" <?php if($bq_cate_id == 13): ?>selected="selected"<?php endif; ?>><?php echo L("ZP_MEIYAN");?></option>
                        <option value ="id2" <?php if($bq_cate_id == 12): ?>selected="selected"<?php endif; ?>><?php echo L("ZP_MEILICZ");?></option>
                        <option value ="id3" <?php if($bq_cate_id == 11): ?>selected="selected"<?php endif; ?>><?php echo L("ZP_OTHERMZ");?></option>
                    </select>
                     <select name="zp_biaoqian" id="child_id">
			
			<option value="<?php echo ($vo["zp_biaoqian"]); ?>"  selected="selected"><?php echo ($vo["zp_biaoqian"]); ?></option>
			
                    </select>

                </td>
	</tr>
        
        <?php if($vo['zp_pic']): ?><tr>
		<th><?php echo L("ZP_PIC");?></th>
		<td id ="fileInput">                 	
                    <div class="img_list">		
                    <img src="<?php echo (getImgName($vo["zp_pic"],100,100,1,true)); ?>" />
                    <div class="blank9"></div>
                    <a href="javascript:void(0);" onclick="del_zppic(<?php echo ($vo["zp_id"]); ?>,this);"><?php echo L("DELETE");?></a>
                    </div>			
		</td>
	</tr>	
        <?php else: ?>
            <tr>
		<th><?php echo L("ZP_PIC");?></th>
		<td><input type="file" class="fileinput" name="zp_pic" size="30" /></td>
            </tr><?php endif; ?>
        <tr>
		<th width="180"><?php echo L("ZP_PRICE");?></th>
		<td><input type="text" class="textinput requireinput" name="zp_price" size="10" value="<?php echo ($vo["zp_price"]); ?>"/></td>
	</tr>
        <tr>
		<th width="180"><?php echo L("ZP_GUIGE");?></th>
		<td><input type="text" class="textinput requireinput" name="zp_guige" size="10" value="<?php echo ($vo["zp_guige"]); ?>"/></td>
	</tr>
        <tr>
		<th width="180"><?php echo L("ZP_JIESHAO");?></th>
		<td><textarea name="zp_jieshao" class="textinput areainput" rows="5" ><?php echo ($vo["zp_jieshao"]); ?></textarea></td>
	</tr>
        <tr>
		<th><?php echo L("SEO_KEYWORDS");?></th>
		<td>
			<textarea name="seo_keywords" class="textinput areainput" rows="3"><?php echo ($vo["seo_keywords"]); ?></textarea>
		</td>
	</tr>
	<tr>
		<th><?php echo L("SEO_DESC");?></th>
		<td>
			<textarea name="seo_desc" class="textinput areainput" rows="3"><?php echo ($vo["seo_desc"]); ?></textarea>
		</td>
	</tr>
	<tr>
		<th><?php echo L("ZP_STATUS");?></th>
		<td>
			<label><input type="radio" name="zp_status" value="1" <?php if($vo["zp_status"] == 1): ?>checked="checked"<?php endif; ?> /><span><?php echo L("YES");?></span></label>
			<label><input type="radio" name="zp_status" value="0" <?php if($vo["zp_status"] == 0): ?>checked="checked"<?php endif; ?> /><span><?php echo L("NO");?></span></label>
		</td>
	</tr>
	
	<tr class="act">
		<th>&nbsp;</th>
		<td>
			<input type="hidden" name="zp_id" value="<?php echo ($vo["zp_id"]); ?>" />
			<input type="submit" class="submit_btn" value="<?php echo L("SUBMIT");?>" />
			<input type="reset" class="reset_btn" value="<?php echo L("RESET");?>" />
		</td>
	</tr>
</table>
</form>

						</div>
					</td>
				</tr>
			</table>
		</div>
	</div>
	<div class="ajax-loading"></div>
</body>
<script type="text/javascript">
jQuery(function($){
	updateBodyDivHeight();
	$(window).resize(function(){
		updateBodyDivHeight();
	});
});

function updateBodyDivHeight()
{
	jQuery(".body-table-div").height(jQuery(".fanwe-body").height() - 36);
	if(jQuery(".body-table-div").get(0).scrollHeight > jQuery(".body-table-div").height())
	{
		var width = jQuery(".body-table-div").width() - 16;
		jQuery(".body-table-div > *").each(function(){
			if(!$(this).hasClass('ajax-loading'))
			{
				$(this).width(width)	
			}
		});
	}
}
</script>
</html>